<!doctype html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>cat game</title>


  <script>
    var lg = lg || {};
    var createjs = lg;
  </script>
  
  <script src="../res/gameConfig.js"></script>
<script src="../res/TweenMax.min.js"></script>
<script src="../res/system.js"></script>
<script src="../res/create.js"></script>
<script src="../res/app.js"></script>


<!--<script src="config.js"></script>-->
<style type="text/css">
  *{
    margin: 0;
    padding: 0;
  }
  </style>
</head>
<body style="background:#125d8e" onload="init()">
<!-- this will be our entry component for the application -->
<app></app>
<input id="c" value="0"/>
<button onclick="brush(document.getElementById('c').value,'false')">跳</button>
<button onclick="clearData()">清空缓存</button>
<canvas id="canvasElement" onclick="setScore()" width="750" height="1334"></canvas>
<script>
  var game;
  var canFight=false;

  apiready = function() {
    init();

  }
  function init() {
        game = new App();
        gameInit();
        setTimeout(
          function()
          {
            canFight=true;
            brush(2,false);
          },2500
        )
  }
    function brush(pos,isremove)
  {
    isremove=true;
    if(canFight)
      game.nextEnemyFight(pos,isremove);
  }
  function gameInit() {
    game.isDebug = true;//可以点击游戏加分,测试用,改为false就不行了
  }
  //接口
  function setScore() {
     game.setScore();
  }
    function changeScore(v) {
     game.changeScore(v);
  }
  function clearData()
  {
    if($api)
        {
           $api.clearStorage();
        }
        else
        {
            localStorage.clear();
        }
    
  }
 
	
  var o = document.getElementById("canvasElement");
  perX = document.body.clientWidth / o.width;
  perY = document.body.scrollHeight / o.height;
  o.style.width = o.width * perX + "px";
  o.style.height = o.height * perY + "px";

  function backBtnHandler(){
    console.log("点击返回")
  }
  function musicHandler()
  {
     console.log("点击 音乐")
  }



</script>
<!--<script type="text/javascript" src="../script/api.js"></script>-->
</body>

</html>